﻿Namespace CommonHand
    ''' <summary>
    ''' Overrides the normal raise value, and defines which bids that are better.
    ''' </summary>
    ''' <remarks></remarks>
    Public Class CommonHandBidValue
        Inherits RaiseBidValue

        Public Sub New(ByVal dieValue As Integer, ByVal dieCount As Integer)
            MyBase.New(dieValue, dieCount)
        End Sub


        ''' <summary>
        ''' Evaluates which raise bid is best.
        ''' </summary>
        ''' <param name="raiseValue"></param>
        ''' <returns></returns>
        ''' <remarks>In this implementation of common hand a higher die value is always better, and a lower is always worse. 
        ''' In the case of equal die value the highest die count wins.</remarks>
        Public Overrides Function IsHigherThan(ByVal raiseValue As RaiseBidValue) As Object
            If (Me.DieValue > raiseValue.DieValue) Then
                Return True
            ElseIf (Me.DieValue < raiseValue.DieValue) Then
                Return False
            Else
                Return Me.DieCount > raiseValue.DieCount
            End If
        End Function
    End Class
End Namespace